package com.drg.center.entity.enums;

/**
 * @Author: zhangxilin
 * @Date: 2022/11/9
 */
public enum UserStatusEnum {
    ENABLE(1,"启用"),
    DISABLE(0,"注销"),
    FROZEN(2,"冻结"),
    ;

    private Integer code;

    private String desc;

    UserStatusEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static UserStatusEnum getByCode(Integer code){
        for (UserStatusEnum enums : UserStatusEnum.values()){
            if (enums.getCode().equals(code)){
                return enums;
            }
        }
        return  null;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }
}
